﻿var ViewPortCtl = function() {

};

Ext.extend(ViewPortCtl, Object, {

	bdCmp : function() {

		var items = this.getItems();

		var viewport = new Ext.Viewport({
					layout : 'border',
					items : items
				});

		var otc = cf.getC('otc');
		otc.expandChildNodes();

	},
	getItems : function() {

		var items = this.getCenterPanel();
		var northPanel = this.getNorthPanel();

		items.push(northPanel);

		return items;

	},
	getNorthPanel : function() {

		var gcc = cf.getC('gcc');

		var user = gcc.user;

		var s = cf.getC('s');

		var url = s.getUrl({
					resource : 'user.do?m=logout'
				});
		
		var width = gcc.sw - 300;

		var panel = new Ext.Panel({
			region : 'north',
			split : true,
			html : '<div style="padding: 30px 0px 0px '
					+ width
					+ 'px;background-image:url(image/logo.PNG);background-repeat: no-repeat;">'
					+ '你好 ！ '
					+ user.username
					+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="'
					+ url + '">安全退出</a>' + '</div>',
			height : 60
		});

		return panel;

	},
	getCenterPanel : function() {

		var otc = cf.getC('otc');
		var otcCmp = otc.getComponent();
		//
		var rpc = cf.getC('rpc');
		var rpcCmp = rpc.getComponent();
		//
		// var avc = cf.getC('avc');
		// var avcCmp = avc.getComponent();

		var items = [rpcCmp, otcCmp];

		return items;

	}

});